package com.hrms.domain;

import java.text.ParseException;
import java.util.Date;
import java.util.Map;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable(detachable="true")
public class BlockingStep extends BusinessObjectImpl {

	public static final String TYPE = BlockingStep.class.getSimpleName();
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	@Persistent
	private String userId;
	
	/*@Persistent
	private Task task; //Key Index of PI Reference Item
*/	
	@Persistent
	private Key taskKey; //Key Index of PI Reference Item
	
	@Persistent
	private String blockingStep;
	@Persistent
	private Date date;
	@Persistent
	private String waitingFor;
	@Persistent
	private String status;
	
	
	public static enum STATUS {
		Blocking, Close
	}
	
	

	public BlockingStep() {
		super();
		// TODO Auto-generated constructor stub
	}


	public BlockingStep(Map<String, String[]> parameterMap, String prefix)
			throws IllegalArgumentException, IllegalAccessException,
			ParseException {
		super(parameterMap, prefix);
		// TODO Auto-generated constructor stub
	}


	public BlockingStep(Map<String, String[]> parameterMap)
			throws IllegalArgumentException, IllegalAccessException,
			ParseException {
		super(parameterMap);
		// TODO Auto-generated constructor stub
	}


	@Override
	public void jdoPreStore()  {
		setDate(new Date());
		setUserId(userId.toLowerCase());
	}
	

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}



	public Key getKey() {
		return key;
	}
	public void setKey(Key key) {
		this.key = key;
	}
	
	public Key getTaskKey() {
		return taskKey;
	}
	public void setTaskKey(Key taskKey) {
		this.taskKey = taskKey;
	}
	public String getBlockingStep() {
		return blockingStep;
	}
	public void setBlockingStep(String blockingStep) {
		this.blockingStep = blockingStep;
	}
	public String getWaitingFor() {
		return waitingFor;
	}
	public void setWaitingFor(String waitingFor) {
		this.waitingFor = waitingFor;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	
}
